<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新闻类别列表</title>
<script type="text/javascript">  
    function check() {  
        var confirmBox = document.getElementById("allselect");//  
        if (confirmBox.checked) {  
            var arryObj = document.getElementsByName("chkbox");  
            for ( var i = 0; i < arryObj.length; i++) {  
                if (typeof arryObj[i].type != "undefined"  
                        && arryObj[i].type == 'checkbox')  
                arryObj[i].checked = true; 
            }  
        } else {  
            var arryObj = document.getElementsByName("chkbox")  
            for ( var i = 0; i < arryObj.length; i++) {  
  
                if (typeof arryObj[i].type != "undefined"  
                        && arryObj[i].type == 'checkbox')  
                    arryObj[i].checked = false;  
            }  
        }  
    }
</script>  
</head>
<body>
	<ul>
     <li><a href="<s:url action='newsType_list'/>">新闻类别</a></li>	
     <li><a href="<s:url action='newsType_goAdd'/>">添加类别</a></li>	
 	</ul>
 	  <hr/>
 	  
 	  <s:form id="newsTypeForm" action="newsType_deleteMore"  method="post" enctype="multipart/form-data">  
 	       全选：<input type="checkbox" name="allselect" id="allselect" onclick="check()"/>
 	       <input type="submit" name="submit" value="批量删除" onclick="return confirm('确定删除该?')?true:false;" />
 	  <s:iterator value="newsTypes" status="itStatus">
	  		<li>
	  			<s:property value="#itStatus.count" />
	  			<s:property value="name"/>
	  			
	  			<s:if test='parentNewsType==null' >顶级类 </s:if>
	  			<s:else><s:property value="parentNewsType.name"/> </s:else>
	  			
	  			<s:property value="serial_number"/>
	  			
	  			<s:url action="newsType_goUpdate" id="myUrl">
				       <s:param name="id" value="id"/>
				    </s:url>	
		        <a href='<s:property value="#myUrl" />'>修改 </a>
		        &nbsp;&nbsp; 
		        <a href="newsType_delete?id=<s:property value='id'/>"   onclick="return confirm('确定删除?');">删除</a>
		        <input type="checkbox" name="chkbox" id="chkbox" value='<s:property value="id"/>' />  
	  		</li>
		</s:iterator>
	</s:form> 
	
</body>
</html>